<?php

namespace app\shell;

use share\console\CConsole;
use share\console\CLIRunner;
use share\service\AliyunDySmsService;
use share\service\SendCodeService;

/**
 * 短信发送测试
 */
class CSms extends CLIRunner
{

    public function test_action()
    {
        $params = [
            'code' => '123456',
        ];
        $config = [
            'accessKeyId' => 'LTAI4G6QpwaQtow55xGXsuBn',
            'accessKeySecret' => '3aXbpIDQkdiCEvIi2H1Chm1qidHCX0',
            'signName' => 'ENZ',
            'TemplateCode' => 'SMS_207665064',
        ];

        return AliyunDySmsService::sendSMS('17688794855', $params, $config);
    }

    public function send_sms_action()
    {
        $params = [
            "vendor" => "ENZ",
            "package" => "com.antsvision.seeeasy",
            "language" => "zh-cn",
            "location" => "cn",
            "scene" => "register",
            "sendType" => "phone",
            "receiver" => "17688794855",
            "code" => "857490",
            "ext" => [
                "phoneCode" => "86",
                "isoCode" => "zh-CN"
            ],
        ];
        SendCodeService::sendSMS($params);
    }
}
